﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AdaptiveAgents
{
    class Record
    {
        private double m_dAgentEpsilon0;
        private double m_dAgentEpsilon1;
        private double m_dAgentEpsilon2;

        private double m_dAgentCompetence0;
        private double m_dAgentCompetence1;
        private double m_dAgentCompetence2;

        private double m_dNumOfTurnsPlayed0;
        private double m_dNumOfTurnsPlayed1;
        private double m_dNumOfTurnsPlayed2;

        public Record()
        {
            m_dAgentEpsilon0 = 0;
            m_dAgentEpsilon1 = 0; 
            m_dAgentEpsilon2 = 0;
            m_dAgentCompetence0 = 0;
            m_dAgentCompetence1 = 0;
            m_dAgentCompetence2 = 0;
            m_dNumOfTurnsPlayed0 = 0;
            m_dNumOfTurnsPlayed1 = 0;
            m_dNumOfTurnsPlayed2 = 0;
        }

        public Record(double eps0, double eps1, double eps2, double comp0, double comp1, double comp2, double turns0, double turns1, double turns2)
        {
            m_dAgentEpsilon0 = eps0;
            m_dAgentEpsilon1 = eps1;
            m_dAgentEpsilon2 = eps2;
            m_dAgentCompetence0 = comp0;
            m_dAgentCompetence1 = comp1;
            m_dAgentCompetence2 = comp2;
            m_dNumOfTurnsPlayed0 = turns0;
            m_dNumOfTurnsPlayed1 = turns1;
            m_dNumOfTurnsPlayed2 = turns2;
        }

        public Record(Record rec)
        {
            m_dAgentCompetence0 = rec.getCompetence(0);
            m_dAgentCompetence1 = rec.getCompetence(1);
            m_dAgentCompetence2 = rec.getCompetence(2);

            m_dAgentEpsilon0 = rec.getEpsilon(0);
            m_dAgentEpsilon1 = rec.getEpsilon(1);
            m_dAgentEpsilon2 = rec.getEpsilon(2);

            m_dNumOfTurnsPlayed0 = rec.getNumOfTurnsPlayed(0);
            m_dNumOfTurnsPlayed1 = rec.getNumOfTurnsPlayed(1);
            m_dNumOfTurnsPlayed2 = rec.getNumOfTurnsPlayed(2);
        }


        public void setEpsilon(double eps, int agent)
        {
            if (agent == 0)
            {
                m_dAgentEpsilon0 = eps;
            }
            else if (agent == 1)
            {
                m_dAgentEpsilon1 = eps;
            }
            else if (agent == 2)
            {
                m_dAgentEpsilon2 = eps;
            }
        }

        public double getEpsilon(int agent)
        {
            if (agent == 0)
            {
                return m_dAgentEpsilon0;
            }
            else if (agent == 1)
            {
                return m_dAgentEpsilon1;
            }
            else if (agent == 2)
            {
                return m_dAgentEpsilon2;
            }
            return 0;
        }

        public void setCompetence(double comp, int agent)
        {
            if (agent == 0)
            {
                m_dAgentCompetence0 = comp;
            }
            else if (agent == 1)
            {
                m_dAgentCompetence1 = comp;
            }
            else if (agent == 2)
            {
                m_dAgentCompetence2 = comp;
            }
        }

        public double getCompetence(int agent)
        {
            if (agent == 0)
            {
                return m_dAgentCompetence0;
            }
            else if (agent == 1)
            {
                return m_dAgentCompetence1;
            }
            else if (agent == 2)
            {
                return m_dAgentCompetence2;
            }
            return 0;
        }

        public void setNumOfTurnsPlayed(double num, int agent)
        {
            if (agent == 0)
            {
                m_dNumOfTurnsPlayed0 = num;
            }
            else if (agent == 1)
            {
                m_dNumOfTurnsPlayed1 = num;
            }
            else if (agent == 2)
            {
                m_dNumOfTurnsPlayed2 = num;
            }
        }

        public double getNumOfTurnsPlayed(int agent)
        {
            if (agent == 0)
            {
                return m_dNumOfTurnsPlayed0;
            }
            else if (agent == 1)
            {
                return m_dNumOfTurnsPlayed1;
            }
            else if (agent == 2)
            {
                return m_dNumOfTurnsPlayed2;
            }
            return 0;
        }


    }
}
